# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Artem Vorotnikov <artem@vorotnikov.me>

_gemname=rspec
pkgname=ruby-${_gemname}
pkgver=3.12.0
pkgrel=1
pkgdesc='RSpec meta-gem that depends on the other components'
url='https://github.com/rspec/rspec'
arch=('any')
license=('MIT')
depends=('ruby-rspec-core' 'ruby-rspec-expectations' 'ruby-rspec-mocks')
options=('!emptydirs')
source=(https://rubygems.org/downloads/${_gemname}-${pkgver}.gem)
noextract=(${_gemname}-${pkgver}.gem)
sha512sums=('24278c467e5226ad1a5bb4c64190fb5d1077777237d9c2e5c4f16a00b026bf26d8f15e2c74a34221b198992f73ef06af314488a61358968e2083f935467e5a35')

package() {
  local _gemdir="$(ruby -e'puts Gem.default_dir')"
  gem install --ignore-dependencies --no-user-install -i "${pkgdir}${_gemdir}" -n "${pkgdir}/usr/bin" ${_gemname}-${pkgver}.gem
  install -Dm 644 "${pkgdir}${_gemdir}/gems/${_gemname}-${pkgver}/LICENSE.md" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm 644 "${pkgdir}${_gemdir}/gems/${_gemname}-${pkgver}/README.md" "${pkgdir}/usr/share/doc/${pkgname}/README"
  rm "${pkgdir}/${_gemdir}/cache/${_gemname}-${pkgver}.gem"
}

# vim: ts=2 sw=2 et:
